<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="org.hibernate.SessionFactory"%>
<%@ page import="org.hibernate.Session"%>
<%@ page import="java.util.List"%>
<%@ page import="hibernate.model.*"%>
<%@ page import="hibernate.util.HibernateUtil"%>
<%@ page import="hibernate.method.*"%>
<%@ page import="hibernate.method.LocalMethods"%>

<div class="page-header">
	<h2 class="page-title">Dodawanie nowego uzytkownika</h2>
</div>

<br />

<div id="content">

<form role="form" style="position: block; top: -40px;" id='addClient' enctype="multipart/form-data"
		action="../AddUser" method="POST">

		<table>
			<tr>
				<td>Nick:</td>
				<td>
					<div class="templatemo_form">
						<input type="text" id="username" name="username"
							class="form-control" required
							placeholder="Wpisz nazwe uzytkownika" maxlength="80"
							autocomplete="off" onkeyup="validate('username')">
					</div>
				</td>
<td>
					<div id="usernameMessage"></div>
				</td>
			</tr>
			<tr>

				<td>Data urodzenia:</td>
				<td>
					<!-- <input type="text" id="birth_date" name="birth_date"> -->
					<div class="templatemo_form">
						<input type="date" id="birth_date" name="birth_date" required
							placeholder="Wpisz datę" class="form-control"
							pattern="(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))">
					</div>
			</tr>

			<tr>

				<td>Podaj email:</td>
				<td>
					<div class="templatemo_form">
						<input type="email" id="email" name="email" required class="form-control"
							placeholder="Wpisz adres e-mail" maxlength="255" onkeyup="validate('email')">
					</div>
				</td>
				<td>
					<div id="emailMessage"></div>
				</td>

			</tr>

			<tr>
				<td>Hasło:</td>
				<td><div class="templatemo_form">
						<input type="password" id="password" name="password" class="form-control" required
							placeholder="Wpisz hasło" maxlength="80">
					</div></td>
<td>
<div id="passwordCheck"></div>
			</tr>
			<tr>
				<td>Powtórz haslo:</td>
				<td><div class="templatemo_form">
						<input type="password" id="confirm_password" class="form-control"
							name="confirm_password" required placeholder="Powtórz hasło"
							maxlength="80">
					</div></td>
<td>
<div id="confirmpasswordCheck"></div>
</td>
			</tr>
			
			<tr>
			<td> Typ: </td>
				<td>
				<div class="templatemo_form">
						<select id="type" name="type" required>
							<option value="client" selected>klient</option>
							<option value="worker">pracownik</option>
							<option value="admin"> administrator </option>
						</select>
				
				
				</td>
			</tr>
			<tr>
				<td>Płec:</td>
				<td><div class="templatemo_form">
						<select id="gender" name="gender" required>
							<option value="male" selected>męzczyzna</option>
							<option value="female">kobieta</option>
						</select>
					</div></td>

			</tr>
			<tr>
				<td>Imię:</td>
				<td><div class="templatemo_form">
						<input type="text" name="name" id="name" class="form-control"
							placeholder="Wpisz swoje imię" maxlength="255" required="required">
					</div></td>

			</tr>
			<tr>
				<td>Nazwisko:</td>
				<td><div class="templatemo_form">
						<input type="text" name="surname" id="surname" class="form-control"
							placeholder="Wpisz swoje nazwisko" maxlength="255">
					</div></td>

			</tr>
			<tr>
				<td>Numer telefonu:</td>
				<td><div class="templatemo_form">
						<input type="tel" name="phone" id="phone" class="form-control"
							placeholder="666-666-666" maxlength="80"
							pattern="\d{3}[\-]\d{3}[\-]\d{3}">
					</div></td>

			</tr>
			<tr>
					<td>Avatar: </td>
					<td><input type="file" name="avatar" id="avatar" size="50"/></td>
				</tr>
		</table>
		<div class="templatemo_form">
			<button class="btn btn-primary" type="submit" id="registration">Zarejestruj
				mnie!</button>
		</div>
	</form>
	
	
</div>